<?php

/**
 * Description of AddPost
 *
 * @author Suraj
 */
class Form_Addpost extends Zend_Form{
    public function __construct() {

        parent::__construct();

        
        //$this->setAction('/admin/add')
        $this->setMethod('post');
       

        // create title textbox
        $title= $this->createElement('text', 'Title');
        $title->setLabel('Title')
              ->addFilter('StripTags')
			  ->addFilter('StringTrim')
			  ->addValidator('NotEmpty')
              ->setRequired(true);

        //create description text area
        $article= $this->createElement("textarea","Description");
        $article->setLabel("Story")
                ->addFilter("StripTags")
                ->addFilter("StringTrim")
                ->addValidator('NotEmpty')
                ->setRequired(true);

        $hidden_id= $this->createElement("hidden", "id");

        // add elemets to the post
        $this->addElement($title)
             ->addElement($article)
             ->addElement($hidden_id)
             ->addElement("submit", "Save", array('label' => 'Save'));

    }
}
?>
